package com.mes.schedule.manager.iface;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.mes.schedule.domain.SOperationTask;
import com.mes.schedule.domain.ScheduleEvent;
import com.mes.schedule.domain.ScheduleOperationRecord;
import com.mes.schedule.domain.ScheduleScheme;

/*import com.mes.schedule.persistence.domain.SOperationTask;
import com.mes.schedule.persistence.domain.ScheduleEvent;
import com.mes.schedule.persistence.domain.ScheduleOperationRecord;
import com.mes.schedule.persistence.domain.ScheduleScheme;
import com.mes.task.persistence.domain.OperationTask;*/

/**
 * 调度方案同步管理 ClassName: ScheduleSyncManager <br/> Function: TODO ADD FUNCTION.
 * <br/> Reason: TODO ADD REASON. <br/> date: Jun 22, 2015 9:11:12 PM <br/>
 * 
 * @author Administrator
 * @version
 * @since JDK 1.6
 */
public interface IScheduleSyncManager {
	/**
	 * 同步调度方案
	 */
	public String syncScheme(ScheduleScheme scheme) throws Exception;

	/**
	 * 新反馈加工记录
	 */
	public String addWorkRecord(ScheduleScheme scheme, Date thisUpdateTime,
			Map<String, SOperationTask> OperationTaskMap) throws Exception;

	/**
	 * 新反馈加工记录
	 */
	public String addWorkRecord(ScheduleScheme scheme,
			Map<String, SOperationTask> OperationTaskMap) throws Exception;

	/**
	 * 新增工作中心替换记录
	 */
	public String updateAssnignmentWorkCenter(ScheduleScheme scheme,
			Date thisUpdateTime, Map<String, SOperationTask> OperationTaskMap)
			throws Exception;

	/**
	 * 新增报废记录
	 */
	public String addReject(ScheduleScheme scheme, Date thisUpdateTime,
			Map<String, SOperationTask> OperationTaskMap) throws Exception;

	/**
	 * 新投产零件任务
	 */
	public String addPartTask(ScheduleScheme scheme) throws Exception;

	/**
	 * 零件工程变更
	 */
	public String engineeringChange(ScheduleScheme scheme) throws Exception;

	/**
	 * 报废零件任务
	 */
	public String rejectparttask(ScheduleScheme scheme) throws Exception;

	/**
	 * 新投产零件任务
	 */
	public String cancelPartTask(ScheduleScheme scheme) throws Exception;

	/**
	 * 取消工序任务
	 */
	public String cancelOperationTask(ScheduleScheme scheme) throws Exception;

	/**
	 * 输出发布计划
	 */
	public String publishScheme(ScheduleScheme scheme) throws Exception;

	/**
	 * 输出发布计划
	 */
	public String publishScheme(ScheduleScheme scheme, String publishType)
			throws Exception;

	/**
	 * 发布派工指令计划
	 */
	public String publishDispatchOrder(ScheduleScheme scheme) throws Exception;

	/**
	 * 取消派工指令计划
	 */
	public String clearDispatchOrder(ScheduleScheme scheme) throws Exception;

	/**
	 * 发布计划时间
	 */
	public String publishPlanTime(ScheduleScheme scheme) throws Exception;

	/**
	 * 取消计划时间
	 */
	public String clearPlanTime(ScheduleScheme scheme) throws Exception;

	/**
	 * 发布生产准备指令
	 */
	public String publishPrepareOrder(ScheduleScheme scheme) throws Exception;

	/**
	 * 取消生产准备指令
	 */
	public String clearPrepareOrder(ScheduleScheme scheme) throws Exception;

	// /**
	// * 同步协作任务

	// */
	// public String syncCoInTask(ScheduleScheme scheme,Date thisUpdateTime)
	// throws Exception;
	// /**
	// * 同步委外任务
	// */
	// public String syncCoOutTask(ScheduleScheme scheme,Date thisUpdateTime)
	// throws Exception;
	//	

	/**
	 * 同步交期变更信息
	 */
	// public String syncLateFinishChange(ScheduleScheme scheme,Date
	// thisUpdateTime) throws Exception;
	/**
	 * 同步所有调度事件
	 */
	public String syncScheduleEvents(ScheduleScheme scheme,
			Date thisUpdateTime, Map<String, SOperationTask> OperationTaskMap)
			throws Exception;

	public String syncScheduleEvents(ScheduleScheme scheme,
			Map<String, SOperationTask> OperationTaskMap) throws Exception;

	String publishDispatchOrderTime(ScheduleScheme scheme) throws Exception;

	public void clearFinishedTask(ScheduleScheme scheme) throws Exception;

	// /**
	// * 在制品数量变更事件
	// * @param scheme
	// * @param thisUpdateTime
	// * @param OperationTaskMap
	// * @return
	// * @throws Exception
	// */
	// String addWipQtyChange(ScheduleScheme scheme, Date thisUpdateTime,
	// Map<String, SOperationTask> OperationTaskMap) throws Exception;

	/**
	 * 使用事件更新调度信息 by hba
	 * 
	 * @param eventList
	 * @param scheme
	 * @throws ParseException
	 */
	public void applyEventToScheme(List<ScheduleEvent> eventList,
			ScheduleScheme scheme) throws ParseException;

	/**
	 * 将任务操作应用到调度方案 by hba
	 * 
	 * @param recordList
	 * @param scheme
	 * @throws ParseException
	 * @throws Exception 
	 */
	public void applyOperationToScheme(
			List<ScheduleOperationRecord> recordList, ScheduleScheme scheme)
			throws ParseException, Exception;

	/**
	 * 事件的前进、后退处理 by hba
	 * 
	 * @param eventList
	 * @param scheme
	 * @throws Exception 
	 */
	public void reverseEvent(List<ScheduleEvent> eventList,
			ScheduleScheme scheme) throws Exception;

	/**
	 * 根据传入的事件参数从content中得到其值 by hba
	 * 
	 * @param eventList
	 * @param eventPara
	 * @param scheme
	 */
	public String getEventPara(List<ScheduleEvent> eventList, String eventPara,
			ScheduleScheme scheme);

	/**
	 * 发布基准计划，将计划开始和结束时间填入基准开始和结束 hba
	 * 
	 * 
	 * @param scheme
	 * @return
	 * @throws Exception
	 */
	public String publishBasePlan(ScheduleScheme scheme) throws Exception;

}
